#ifndef __STM32_POWER_H__
#define __STM32_POWER_H__

#include <stdint.h>
#include "main.h"


// 低功耗模式
#define	PWR_FULL_MODE         0x00
#define PWR_LPRUN_MODE        0x01
#define	PWR_SLEEP_MODE        0x02
#define	PWR_LPSLEEP_MODE      0x03
#define PWR_STOP0_MODE        0x04
#define PWR_STOP1_MODE        0x05
#define PWR_STOP2_MODE        0x06
#define	PWR_STANDBY_MODE      0x07
#define	PWR_SHUTDOWN_MODE		  0x08


#define PWR_WAKEUP_AFTER_CLK_HSI     0x01
#define PWR_WAKEUP_AFTER_CLK_HSE     0x02

#define DEBUG_MODE_ENABLE     0x01
#define DEBUG_MODE_DISABLE    0x02


void STM32_PWR_Enter_LowPowerMode(uint8_t LPMode, uint8_t DebugMode);
void STM32_PWR_Enter_StopMode(uint8_t StopMode, uint8_t DebugMode);

void STM32_PWR_Enter_FullRunMode(void);
void STM32_PWR_Enter_LPRunMode(void);
void STM32_PWR_Enter_SleepMode(void);
void STM32_PWR_Enter_LPSleepMode(void);
void STM32_PWR_Enter_Stop0Mode(void);
void STM32_PWR_Enter_Stop1Mode(void);
void STM32_PWR_Enter_Stop2Mode(void);
void STM32_PWR_Enter_StandbyMode(void);
void STM32_PWR_Enter_ShutdownMode(void);


void STM32_RCC_SystemClock_Internal(void);	// 系统时钟配置--内部
void STM32_RCC_SystemClock_External(void);	// 系统时钟配置--外部


#endif
